using System;
using System.Collections.Generic;
using Matrix.ServiceDiscovery.Enums;

namespace Matrix.ServiceDiscovery.Contracts.Dtos
{
    /// <summary>
    /// 负载均衡配置DTO
    /// </summary>
    public class LoadBalancingConfigDto
    {
        /// <summary>
        /// ID
        /// </summary>
        public Guid Id { get; set; }

        /// <summary>
        /// 服务ID
        /// </summary>
        public Guid ServiceId { get; set; }

        /// <summary>
        /// 负载均衡策略
        /// </summary>
        public LoadBalancingStrategy Strategy { get; set; }

        /// <summary>
        /// 是否启用健康检查
        /// </summary>
        public bool EnableHealthCheck { get; set; }

        /// <summary>
        /// 健康检查间隔
        /// </summary>
        public TimeSpan HealthCheckInterval { get; set; }

        /// <summary>
        /// 失败阈值
        /// </summary>
        public int FailureThreshold { get; set; }

        /// <summary>
        /// 成功阈值
        /// </summary>
        public int SuccessThreshold { get; set; }

        /// <summary>
        /// 超时时间
        /// </summary>
        public TimeSpan Timeout { get; set; }

        /// <summary>
        /// 策略参数
        /// </summary>
        public Dictionary<string, object> Parameters { get; set; } = new();

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreationTime { get; set; }

        /// <summary>
        /// 最后修改时间
        /// </summary>
        public DateTime LastModificationTime { get; set; }
    }
}